<template>
  <div>
    <el-button type="blue" @click="openDialog">点击</el-button>
    <Dialog
      @formVisible="formVisible"
      :title="title"
      :dialogFormVisible="dialogFormVisible"
      :formDataInput="formDataInput"
      :formDataSelect="formDataSelect"
      @form="form"
    ></Dialog>
  </div>
</template>

<script>
import Dialog from "@/views/dialog/component/Dialog";
export default {
  components: {
    Dialog,
  },
  data() {
    return {
      dialogFormVisible: false,
      title: "对话框",
      formDataInput: [
        // id    label:标题       name: 参数
        { id: 1, label: "11111", name: "tt1" },
        { id: 2, label: "22222", name: "tt2" },
        { id: 3, label: "33333", name: "tt3" },
        { id: 4, label: "44444", name: "tt4" },
      ],
      formDataSelect:[
        { label: "11111", name: "xxx1", options: [{ label: "1", value: "1" }] },
        { label: "22222", name: "xxx2", options: [{ label: "2", value: "2" }] },
      ],
    };
  },
  methods: {
    // 控制开关
    openDialog() {
      this.dialogFormVisible = true;
    },
    formVisible(tempData) {
      this.dialogFormVisible = tempData;
    },
    // 返回的数据
    form(data) {
      console.log(data);
    },
  },
};
</script>

<style>
</style>